package com.grass.p019lv.game.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.androidsa.bttsddka.R;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.grass.p019lv.game.bean.GameChargeBean;

/* renamed from: com.grass.lv.game.adapter.GameGoldAdapter */
public class GameGoldAdapter extends BaseRecyclerAdapter<GameChargeBean.GameChargeData, Holder> {
    public void MyHolder(Holder holder, int i) {
        holder.setData((GameChargeBean.GameChargeData) getDataInPosition(i));
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_game_gold, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.grass.lv.game.adapter.GameGoldAdapter$Holder */
    public static class Holder extends BaseRecyclerHolder {
        private TextView item_gold_num;
        private TextView item_gold_perice;
        private RelativeLayout item_gold_view;
        private ImageView item_selected_img;

        Holder(View view) {
            super(view);
            this.item_gold_view = (RelativeLayout) view.findViewById(R.id.item_gold_view);
            this.item_gold_num = (TextView) view.findViewById(R.id.item_gold_num);
            this.item_gold_perice = (TextView) view.findViewById(R.id.item_gold_perice);
            this.item_selected_img = (ImageView) view.findViewById(R.id.item_selected_img);
        }

        /* access modifiers changed from: package-private */
        public void setData(GameChargeBean.GameChargeData gameChargeData) {
            TextView textView = this.item_gold_num;
            textView.setText(gameChargeData.getPrice() + "元");
            TextView textView2 = this.item_gold_perice;
            textView2.setText("" + gameChargeData.getPrice());
            if (gameChargeData.isSelected()) {
                this.item_selected_img.setVisibility(0);
                this.item_gold_view.setBackgroundResource(R.drawable.item_game_gold_selected);
                return;
            }
            this.item_selected_img.setVisibility(8);
            this.item_gold_view.setBackgroundResource(R.drawable.item_game_gold_unselected);
        }
    }
}
